/** 获取昨日日期字符串 */
export const getYesterdayDateStr = () => {
  const today = new Date();
  const yesterday = new Date(today.setDate(today.getDate() - 1));
  let year = yesterday.getFullYear();
  let month = yesterday.getMonth() + 1;
  let day = yesterday.getDate();
  let yesterdayStr = year + '-' + (month > 9 ? month : ('0' + month)) + '-' + (day > 9 ? day : ('0' + day));
  return yesterdayStr;
};

export const getYesterdayCurrentTime = () => {
  const nowTime = Date.now();
  const yesterdayTime = nowTime - 24 * 60 * 60 * 1000;
  return new Date(yesterdayTime);
};
